home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / c_toolbx.arc / SCN3.C < prev    next >
Encoding:
C/C++ Source or Header  |  1988-03-30  |  1.4 KB  |  43 lines

  1. /*  scn3.c - utilities for setting up screen I/O */
  2.  
  3. #include   "stdio.h"
  4. #include   "cminor.h"
  5. #include   "video.h"
  6. #include   "asmtools.h"
  7. #include   "scn.h"
  8.  
  9. #define    EQUIP_DET   0x11     /* software int no. for equiptment */
  10.                                 /* determination */
  11. #define    DISP_BITS   0x30     /* mask for display type bits */
  12. #define    BW_DISP     0x30     /* value of above bits for mono disp. */
  13. #define    CG_USED     1        /* screen type = color/graphics */
  14. #define    MONO_USED   0        /* screen type = monochrome adaptor */
  15.  
  16. int  scn_type()                         /* get type of display adapter used */
  17.   {
  18.      REGS  sreg , dreg ;
  19.  
  20.      swint(EQUIP_DET,&sreg,&dreg) ;
  21.      dreg.ax = dreg.ax & DISP_BITS;     /* isolate display type */
  22.      if( dreg.ax != BW_DISP )           /* is it mono adapter type ? */
  23.         return( CG_USED ) ;             /* no - return Color Gr. in use */
  24.      else  return( MONO_USED ) ;        /* yes - return MONO in use */
  25.   }
  26.  
  27.  
  28. int  scn_addr(pscn)                     /* set display address */
  29.   SCN_DATA *pscn ;                      /* address of screen control block */
  30.   {
  31.      if( scn_type() == MONO_USED )
  32.         {  pscn->scn_seg = MONO_SEG ;
  33.            pscn->stport  = MONO_BASE + CRT_STATUS ;
  34.         }
  35.      else
  36.         {  pscn->scn_seg = CG_SEG ;
  37.            pscn->stport  = COLOR_BASE + CRT_STATUS ;
  38.         }
  39.   }
  40.  
  41.  
  42.  
  43.